import { request } from '@umijs/max'

interface ApiResponse<T> {
  code: number
  msg: string
  data: T
  success: boolean
}

/** 获取深度思考/连网列表 */
export async function getJobList(type: number) {
  return request<ApiResponse<any>>('/aiapi/setting/list?type=' + type, {
    method: 'GET',
  })
}

/** 删除深度思考/连网列表 */
export async function deleteJob(data:any) {
  return request<ApiResponse<any>>(`/aiapi/setting/${data.id}`, {
    method: 'DELETE',
    data
  })
}

/** 添加深度思考/连网列表 */
export async function addJob(data:any) {
  return request<ApiResponse<any>>('/aiapi/setting ', {
    method: 'POST',
    data
  })
}


/** 编辑深度思考/连网列表 */
export async function editJob(data:any) {
  return request<ApiResponse<any>>('/aiapi/setting ', {
    method: 'PUT',
    data
  })
}
